3.198 \(\int \frac{\cot ^2(a+i \log (x))}{x} \, dx\)

Optimal. Leaf size=18 \[ -\log (x)+i \cot (a+i \log (x)) \]

[Out]

I*Cot[a + I*Log[x]] - Log[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0235847, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {3473, 8} \[ -\log (x)+i \cot (a+i \log (x)) \]

Antiderivative was successfully verified.

[In]

Int[Cot[a + I*Log[x]]^2/x,x]

[Out]

I*Cot[a + I*Log[x]] - Log[x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cot ^2(a+i \log (x))}{x} \, dx &=\operatorname{Subst}\left (\int \cot ^2(a+i x) \, dx,x,\log (x)\right )\\ &=i \cot (a+i \log (x))-\operatorname{Subst}(\int 1 \, dx,x,\log (x))\\ &=i \cot (a+i \log (x))-\log (x)\\ \end{align*}

Mathematica [C]  time = 0.0498985, size = 34, normalized size = 1.89 \[ i \cot (a+i \log (x)) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(a+i \log (x))\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[a + I*Log[x]]^2/x,x]

[Out]

I*Cot[a + I*Log[x]]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[a + I*Log[x]]^2]

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 27, normalized size = 1.5 \begin{align*} i\cot \left ( a+i\ln \left ( x \right ) \right ) -{\frac{i}{2}}\pi +i \left ( a+i\ln \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(a+I*ln(x))^2/x,x)

[Out]

I*cot(a+I*ln(x))-1/2*I*Pi+I*(a+I*ln(x))

________________________________________________________________________________________

Maxima [A]  time = 1.72516, size = 26, normalized size = 1.44 \begin{align*} i \, a + \frac{i}{\tan \left (a + i \, \log \left (x\right )\right )} - \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x,x, algorithm="maxima")

[Out]

I*a + I/tan(a + I*log(x)) - log(x)

________________________________________________________________________________________

Fricas [B]  time = 0.476125, size = 97, normalized size = 5.39 \begin{align*} -\frac{e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} \log \left (x\right ) - \log \left (x\right ) + 2}{e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} - 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x,x, algorithm="fricas")

[Out]

-(e^(2*I*a - 2*log(x))*log(x) - log(x) + 2)/(e^(2*I*a - 2*log(x)) - 1)

________________________________________________________________________________________

Sympy [A]  time = 0.538921, size = 20, normalized size = 1.11 \begin{align*} - \log{\left (x \right )} + \frac{2 e^{2 i a}}{x^{2} - e^{2 i a}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*ln(x))**2/x,x)

[Out]

-log(x) + 2*exp(2*I*a)/(x**2 - exp(2*I*a))

________________________________________________________________________________________

Giac [B]  time = 1.31752, size = 43, normalized size = 2.39 \begin{align*} i \, a + \frac{i}{2 \, \tan \left (\frac{1}{2} \, a + \frac{1}{2} i \, \log \left (x\right )\right )} - \log \left (x\right ) - \frac{1}{2} i \, \tan \left (\frac{1}{2} \, a + \frac{1}{2} i \, \log \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(a+I*log(x))^2/x,x, algorithm="giac")

[Out]

I*a + 1/2*I/tan(1/2*a + 1/2*I*log(x)) - log(x) - 1/2*I*tan(1/2*a + 1/2*I*log(x))